package com.leadbank.security.hello.controller;

import com.leadbank.security.hello.service.EmployeeManager;
import com.leadbank.security.hello.util.SpringContextHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by hp on 2018/11/27.
 */
@Controller
public class BeanController {

    private static Log LOGGER = LogFactory.getLog(BeanController.class);

    @Autowired
    private EmployeeManager employeeManager;


    @RequestMapping(value = "/beantest")
    public String testAdd() {

        System.out.println("ShoppingCart is "+this.employeeManager);
        EmployeeManager em1 = SpringContextHelper.getBean("employeeManagerImpl");

        EmployeeManager em2 = SpringContextHelper.getBean("employeeManagerImpl");
        System.out.println(em1);
        System.out.println(em2);
        return "test";
    }
}
